consume the Escape key only if we actually cancel a drag. Fixes bug
authorMichael Natterer <mitch@imendio.com>
Mon, 30 Oct 2006 13:39:34 +0000 (13:39 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Mon, 30 Oct 2006 13:39:34 +0000 (13:39 +0000)
2006-10-30  Michael Natterer  <mitch@imendio.com>

* gtk/gtkrange.c (gtk_range_key_press): consume the Escape key
only if we actually cancel a drag. Fixes bug #58389.

ChangeLog
gtk/gtkrange.c

index ec505667e600e4e8ba01807200bed1b58ebc153a..7d99237ca6ec0a66e5bb810bb34eb89d43273e60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-30  Michael Natterer  <mitch@imendio.com>
+
+       * gtk/gtkrange.c (gtk_range_key_press): consume the Escape key
+       only if we actually cancel a drag. Fixes bug #58389.
+
 2006-10-30  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtktreeview.c (gtk_tree_view_class_init): change left/right
index 231124175265703fb1c1d4d2b5dcc468ee0fa733..ec88c7409fb7b96e9fced1b872628325e2c286e5 100644 (file)
@@ -1541,20 +1541,21 @@ static gboolean
 gtk_range_key_press (GtkWidget   *widget,
                     GdkEventKey *event)
 {
-  GtkRange *range = (GtkRange *)widget;
+  GtkRange *range = GTK_RANGE (widget);
 
-  if (event->keyval == GDK_Escape)
+  if (event->keyval == GDK_Escape &&
+      range->layout->grab_location != MOUSE_OUTSIDE)
     {
       stop_scrolling (range);
 
-      update_slider_position (range, 
+      update_slider_position (range,
                              range->slide_initial_coordinate,
                              range->slide_initial_coordinate);
 
       return TRUE;
     }
-  else
-    return GTK_WIDGET_CLASS (gtk_range_parent_class)->key_press_event (widget, event);
+
+  return GTK_WIDGET_CLASS (gtk_range_parent_class)->key_press_event (widget, event);
 }
 
 static gint